xml = Builder::XmlMarkup.new
xml.chart(:showMean=>1, :caption=>"caption", :palette=>"2", :animation=>"1", :formatNumberScale=>"0", \
:numberPrefix=>"", :labeldisplay=>"ROTATE", :slantLabels=>"1", :seriesNameInToolTip=>"0", \
:sNumberSuffix=>" pcs.", :showValues=>"0", :plotSpacePercent=>"0", :labelDisplay=>"STAGGER", :isHtml=>1) do
  for item in arr_data
    link = "/#{controller.controller_name}/detail/#{item[0]}?from=#{params["from"]}&iso=#{params["iso"]}&p=#{params["p"]}&to=#{params["to"]}"
    #link = url_for(:action=>'state', :id=>item.identifying_phone_number, :p=>params[:p], :from=>params[:from], :to=>params[:to], :iso=>item.iso_country_code)
    xml.set(:label=>"%s %s" % [item[0], item[1]["iso_country_code"]], \
            :value=>item[1]["sum_calls"], \
            :link=>"/#{controller.controller_name}/src_phone_detail/#{item[0]}?from=#{params["from"]}&iso=#{item[1]["iso_country_code"]}&p=#{params["p"]}&to=#{params["to"]}")
  end

  xml.styles() do
    xml.definition() do
      xml.style(:type=>"font", :name=>"CaptionFont", :size=>"15", :color=>"666666")
      xml.style(:type=>"font", :name=>"SubCaptionFont", :bold=>"0")
    end
    xml.application()do
      xml.apply(:toObject=>"caption", :styles=>"CaptionFont")
      xml.apply(:toObject=>"SubCaption", :styles=>"SubCaptionFont")
    end
  end # styles
end # chart